import requests

from config import BASE_URL

class BeautyApi:

    #获取所有
    @classmethod
    def get_beauty_all(cls,headers):
        return requests.get(BASE_URL + "/beauty/",headers=headers)
    #新增beauty
    @classmethod
    def add_beauty(cls,headers,json_data):
        return requests.post(BASE_URL + "/beauty/",headers=headers,json=json_data)
    #修改beauty
    @classmethod
    def update_beauty(cls,headers,json_data):
        return requests.put(BASE_URL + "/beauty/",headers=headers,json=json_data)
    #删除beauty
    @classmethod
    def delete_beauty(cls,headers,data):
        return requests.delete(BASE_URL + "/beauty/",headers=headers,data=data)
    #获取单个数据
    @classmethod
    def get_beauty_one(cls,headers,data):
        return requests.get(BASE_URL + f"/beauty/{data}",headers=headers)
    #分页获取beauty
    @classmethod
    def get_beauty_page(cls,headers,params):
        return requests.get(BASE_URL + f"/beauty/list",headers=headers,params=params)